﻿using GameFramework.Fsm;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class GuessState_Stoping : GuessStateBase<GuessControl>
{

    protected override void OnKeyDown(KeyCode obj)
    {

    }

    protected override void OnEnter(IFsm<GuessControl> fsm)
    {
        base.OnEnter(fsm);

        Debug.Log("应该写 抽出一个奖品 然后停在那个奖品");
        Debug.Log("开始倒计时动画和音效");

    }

    protected override void OnLeave(IFsm<GuessControl> fsm, bool isShutdown)
    {
        base.OnLeave(fsm, isShutdown);
        Debug.Log("停止倒计时动画和音效");
    }


    protected override void OnUpdate(IFsm<GuessControl> fsm, float elapseSeconds, float realElapseSeconds)
    {
        base.OnUpdate(fsm, elapseSeconds, realElapseSeconds);

        fsm.Owner.Speed -= 0.01f;

        if (fsm.Owner.Speed<=0)
        {
            fsm.Owner.Speed = 0;
            ChangeState<GuessState_Stoped>(fsm);
        }

    }
}
